﻿namespace K9Nano.Captcha;

public interface ICaptchaStore
{
    /// <summary>
    /// 返回未过期的验证码
    /// </summary>
    /// <param name="requestId">请求ID</param>
    /// <returns></returns>
    string? Get(string requestId);

    /// <summary>
    /// 存储验证码
    /// </summary>
    /// <param name="requestId">请求ID</param>
    /// <param name="expire">有效期</param>
    /// <param name="length">验证码长度</param>
    void Save(string requestId, string code, TimeSpan expire);

    /// <summary>
    /// 移除验证码
    /// </summary>
    /// <param name="requestId">请求ID</param>
    void Remove(string requestId);
}
